﻿package com.sh.game.util
{

    public class BooleanArray extends Object
    {
        private var keys:uint = 0;

        public function BooleanArray(param1:uint = 0)
        {
            this.keys = param1;
            return;
        }// end function

        public function setValue(param1:int, param2:Boolean = true) : void
        {
            if (param2)
            {
                this.keys = this.keys | Math.pow(2, param1);
            }
            else if (this.getValue(param1))
            {
                this.keys = this.keys ^ Math.pow(2, param1);
            }
            return;
        }// end function

        public function setAll(param1:uint = 0) : void
        {
            this.keys = param1;
            return;
        }// end function

        public function getValue(param1:int) : Boolean
        {
            return (this.keys & Math.pow(2, param1)) >> param1 == 1;
        }// end function

        public function getKey() : uint
        {
            return this.keys;
        }// end function

    }
}
